<template>
  <div>
    我是B组件(发送方)
    <button @click="clickSend">发布通知</button>
  </div>
</template>

<script>
import Bus from "../utils/EventBus";
export default {
  methods: {
    clickSend() {
      Bus.$emit("sendMsg", "今天晴天，适合郊游");
    },
  },
};
</script>

<style scoped>
div {
  display: inline-block;
  margin: 5px 5px;
  width: 300px;
  height: 200px;
  background-color: orange;
  border: 1px solid black;
  border-radius: 10px;
}
</style>